﻿using System;
using System.Linq.Expressions;

namespace FT.Architecture.Repositories
{
    /// <summary>
    /// Search Member
    /// </summary>
    public struct SearchExpression<T>
    {
        private readonly Expression<Func<T, object>> member;
        private readonly object value;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="member"></param>
        /// <param name="value"></param>
        public SearchExpression(Expression<Func<T, object>> member, object value)
        {
            this.member = member;
            this.value = value;
        }

        /// <summary>
        /// Member to search on
        /// </summary>
        public Expression<Func<T, object>> Member
        {
            get { return member; }
        }

        /// <summary>
        /// Value to search
        /// </summary>
        public object Value
        {
            get { return value; }
        }
    }
}